import { gql } from "@apollo/client";

export interface StudentType {
  id: string;
  name: string;
  account: string;
  avatar: string;
  desc: string;
  tel: string;
}

export const getStudents_service = gql`
    query getStudents($page: PageInput!, $name: String) {
        getStudents(page: $page, name: $name) {
            message
            page {
                total
                pageNum
                pageSize
            }
            data {
                id
                name
                desc
                tel
                avatar
                account
            }
        }
    }
`;

export const getStudentInfo_simple_service = gql`
    query getStudentInfoPc($id: String!) {
        getStudentInfoPc(id: $id) {
            code
            data {
                id
                name
                avatar
            }
        }
    }
`;

// 查询在本机构购买过课程的学生
export const getStudentsByOrgId = gql`
    query getStudentsByOrders($page: PageInput!, $orgId: String!,$name: String) {
        getStudentsByOrders(page: $page,orgId: $orgId,name: $name) {
            message,
            data {
                id
                name
                desc
                tel
                avatar
                account
            },
            page {
                pageNum,
                pageSize,
                total
            },
            code
        }

    }`;

export const getOrdersByUserAndOrg_service = gql`
  query getOrdersByUserAndOrg($transmitUserId: String!) {
    getOrdersByUserId(transmitUserId: $transmitUserId) {
      data {
        id
        orderCode
        userId
        tel
        buyTime
        buyNum
        buyPrice
        productName
        productLogo
      }
      message
    }
  }
`;
